package com.io.nettyflow.clientHandler;

import com.io.model.CustomeMsg;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * Created by yangyx on 2016/7/20.
 */
public class CustomClientHandler extends ChannelInboundHandlerAdapter{
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        System.out.println("执行CustomClientHandler的channelActive方法");
        CustomeMsg customMsg = new CustomeMsg((byte)0xAB, (byte)0xCD, "Hello,Netty".length(), "Hello,Netty");
        ctx.writeAndFlush(customMsg);
        ctx.fireChannelActive();
    }



}
